Optimal. Leaf size=80 \[ \frac {6 b x \cos (c+d x)}{d^3}-\frac {a x \cos (c+d x)}{d}-\frac {b x^3 \cos (c+d x)}{d}-\frac {6 b \sin (c+d x)}{d^4}+\frac {a \sin (c+d x)}{d^2}+\frac {3 b x^2 \sin (c+d x)}{d^2} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.07, antiderivative size = 80, normalized size of antiderivative = 1.00, number of steps
used = 8, number of rules used = 3, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {3420, 3377,
2717} \begin {gather*} \frac {a \sin (c+d x)}{d^2}-\frac {a x \cos (c+d x)}{d}-\frac {6 b \sin (c+d x)}{d^4}+\frac {6 b x \cos (c+d x)}{d^3}+\frac {3 b x^2 \sin (c+d x)}{d^2}-\frac {b x^3 \cos (c+d x)}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2717
Rule 3377
Rule 3420
Rubi steps
\begin {align*} \int x \left (a+b x^2\right ) \sin (c+d x) \, dx &=\int \left (a x \sin (c+d x)+b x^3 \sin (c+d x)\right ) \, dx\\ &=a \int x \sin (c+d x) \, dx+b \int x^3 \sin (c+d x) \, dx\\ &=-\frac {a x \cos (c+d x)}{d}-\frac {b x^3 \cos (c+d x)}{d}+\frac {a \int \cos (c+d x) \, dx}{d}+\frac {(3 b) \int x^2 \cos (c+d x) \, dx}{d}\\ &=-\frac {a x \cos (c+d x)}{d}-\frac {b x^3 \cos (c+d x)}{d}+\frac {a \sin (c+d x)}{d^2}+\frac {3 b x^2 \sin (c+d x)}{d^2}-\frac {(6 b) \int x \sin (c+d x) \, dx}{d^2}\\ &=\frac {6 b x \cos (c+d x)}{d^3}-\frac {a x \cos (c+d x)}{d}-\frac {b x^3 \cos (c+d x)}{d}+\frac {a \sin (c+d x)}{d^2}+\frac {3 b x^2 \sin (c+d x)}{d^2}-\frac {(6 b) \int \cos (c+d x) \, dx}{d^3}\\ &=\frac {6 b x \cos (c+d x)}{d^3}-\frac {a x \cos (c+d x)}{d}-\frac {b x^3 \cos (c+d x)}{d}-\frac {6 b \sin (c+d x)}{d^4}+\frac {a \sin (c+d x)}{d^2}+\frac {3 b x^2 \sin (c+d x)}{d^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.09, size = 57, normalized size = 0.71 \begin {gather*} \frac {-d x \left (a d^2+b \left (-6+d^2 x^2\right )\right ) \cos (c+d x)+\left (a d^2+3 b \left (-2+d^2 x^2\right )\right ) \sin (c+d x)}{d^4} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(180\) vs.
\(2(80)=160\).
time = 0.04, size = 181, normalized size = 2.26
method | result | size |
risch | \(-\frac {x \left (d^{2} x^{2} b +d^{2} a -6 b \right ) \cos \left (d x +c \right )}{d^{3}}+\frac {\left (3 d^{2} x^{2} b +d^{2} a -6 b \right ) \sin \left (d x +c \right )}{d^{4}}\) | \(59\) |
norman | \(\frac {\frac {b \,x^{3} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {\left (d^{2} a -6 b \right ) x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d^{3}}-\frac {b \,x^{3}}{d}-\frac {\left (d^{2} a -6 b \right ) x}{d^{3}}+\frac {2 \left (d^{2} a -6 b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d^{4}}+\frac {6 b \,x^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d^{2}}}{1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}\) | \(127\) |
meijerg | \(\frac {8 b \sqrt {\pi }\, \sin \left (c \right ) \left (\frac {3}{4 \sqrt {\pi }}-\frac {\left (-\frac {3 d^{2} x^{2}}{2}+3\right ) \cos \left (d x \right )}{4 \sqrt {\pi }}-\frac {d x \left (-\frac {d^{2} x^{2}}{2}+3\right ) \sin \left (d x \right )}{4 \sqrt {\pi }}\right )}{d^{4}}+\frac {8 b \sqrt {\pi }\, \cos \left (c \right ) \left (\frac {x d \left (-\frac {5 d^{2} x^{2}}{2}+15\right ) \cos \left (d x \right )}{20 \sqrt {\pi }}-\frac {\left (-\frac {15 d^{2} x^{2}}{2}+15\right ) \sin \left (d x \right )}{20 \sqrt {\pi }}\right )}{d^{4}}+\frac {2 a \sqrt {\pi }\, \sin \left (c \right ) \left (-\frac {1}{2 \sqrt {\pi }}+\frac {\cos \left (d x \right )}{2 \sqrt {\pi }}+\frac {d x \sin \left (d x \right )}{2 \sqrt {\pi }}\right )}{d^{2}}+\frac {2 a \sqrt {\pi }\, \cos \left (c \right ) \left (-\frac {d x \cos \left (d x \right )}{2 \sqrt {\pi }}+\frac {\sin \left (d x \right )}{2 \sqrt {\pi }}\right )}{d^{2}}\) | \(180\) |
derivativedivides | \(\frac {a c \cos \left (d x +c \right )+a \left (\sin \left (d x +c \right )-\left (d x +c \right ) \cos \left (d x +c \right )\right )+\frac {b \,c^{3} \cos \left (d x +c \right )}{d^{2}}+\frac {3 b \,c^{2} \left (\sin \left (d x +c \right )-\left (d x +c \right ) \cos \left (d x +c \right )\right )}{d^{2}}-\frac {3 b c \left (-\left (d x +c \right )^{2} \cos \left (d x +c \right )+2 \cos \left (d x +c \right )+2 \left (d x +c \right ) \sin \left (d x +c \right )\right )}{d^{2}}+\frac {b \left (-\left (d x +c \right )^{3} \cos \left (d x +c \right )+3 \left (d x +c \right )^{2} \sin \left (d x +c \right )-6 \sin \left (d x +c \right )+6 \left (d x +c \right ) \cos \left (d x +c \right )\right )}{d^{2}}}{d^{2}}\) | \(181\) |
default | \(\frac {a c \cos \left (d x +c \right )+a \left (\sin \left (d x +c \right )-\left (d x +c \right ) \cos \left (d x +c \right )\right )+\frac {b \,c^{3} \cos \left (d x +c \right )}{d^{2}}+\frac {3 b \,c^{2} \left (\sin \left (d x +c \right )-\left (d x +c \right ) \cos \left (d x +c \right )\right )}{d^{2}}-\frac {3 b c \left (-\left (d x +c \right )^{2} \cos \left (d x +c \right )+2 \cos \left (d x +c \right )+2 \left (d x +c \right ) \sin \left (d x +c \right )\right )}{d^{2}}+\frac {b \left (-\left (d x +c \right )^{3} \cos \left (d x +c \right )+3 \left (d x +c \right )^{2} \sin \left (d x +c \right )-6 \sin \left (d x +c \right )+6 \left (d x +c \right ) \cos \left (d x +c \right )\right )}{d^{2}}}{d^{2}}\) | \(181\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 165 vs.
\(2 (80) = 160\).
time = 0.28, size = 165, normalized size = 2.06 \begin {gather*} \frac {a c \cos \left (d x + c\right ) + \frac {b c^{3} \cos \left (d x + c\right )}{d^{2}} - {\left ({\left (d x + c\right )} \cos \left (d x + c\right ) - \sin \left (d x + c\right )\right )} a - \frac {3 \, {\left ({\left (d x + c\right )} \cos \left (d x + c\right ) - \sin \left (d x + c\right )\right )} b c^{2}}{d^{2}} + \frac {3 \, {\left ({\left ({\left (d x + c\right )}^{2} - 2\right )} \cos \left (d x + c\right ) - 2 \, {\left (d x + c\right )} \sin \left (d x + c\right )\right )} b c}{d^{2}} - \frac {{\left ({\left ({\left (d x + c\right )}^{3} - 6 \, d x - 6 \, c\right )} \cos \left (d x + c\right ) - 3 \, {\left ({\left (d x + c\right )}^{2} - 2\right )} \sin \left (d x + c\right )\right )} b}{d^{2}}}{d^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.36, size = 60, normalized size = 0.75 \begin {gather*} -\frac {{\left (b d^{3} x^{3} + {\left (a d^{3} - 6 \, b d\right )} x\right )} \cos \left (d x + c\right ) - {\left (3 \, b d^{2} x^{2} + a d^{2} - 6 \, b\right )} \sin \left (d x + c\right )}{d^{4}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.21, size = 99, normalized size = 1.24 \begin {gather*} \begin {cases} - \frac {a x \cos {\left (c + d x \right )}}{d} + \frac {a \sin {\left (c + d x \right )}}{d^{2}} - \frac {b x^{3} \cos {\left (c + d x \right )}}{d} + \frac {3 b x^{2} \sin {\left (c + d x \right )}}{d^{2}} + \frac {6 b x \cos {\left (c + d x \right )}}{d^{3}} - \frac {6 b \sin {\left (c + d x \right )}}{d^{4}} & \text {for}\: d \neq 0 \\\left (\frac {a x^{2}}{2} + \frac {b x^{4}}{4}\right ) \sin {\left (c \right )} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 3.40, size = 60, normalized size = 0.75 \begin {gather*} -\frac {{\left (b d^{3} x^{3} + a d^{3} x - 6 \, b d x\right )} \cos \left (d x + c\right )}{d^{4}} + \frac {{\left (3 \, b d^{2} x^{2} + a d^{2} - 6 \, b\right )} \sin \left (d x + c\right )}{d^{4}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.14, size = 73, normalized size = 0.91 \begin {gather*} \frac {x\,\cos \left (c+d\,x\right )\,\left (6\,b-a\,d^2\right )}{d^3}-\frac {\sin \left (c+d\,x\right )\,\left (6\,b-a\,d^2\right )}{d^4}-\frac {b\,x^3\,\cos \left (c+d\,x\right )}{d}+\frac {3\,b\,x^2\,\sin \left (c+d\,x\right )}{d^2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________